<!DOCTYPE HTML>
<html>

	<head>
		<title>摇奖</title>
		<meta charset="utf-8" />
	</head>

	<body>
		<div>
			<textarea id="user" name="" rows="20" cols="" title="">吴丽娟
			刘义
			邓运超
			杨慧祥
			王伟娇
			周迅</textarea>
		</div>
		<div>
			<h1 id="result">结果：待开奖</h1></div>
		<div><button onclick="run();">摇奖</button></div>
	</body>

	<script type="text/javascript">
        let text = document.getElementById("user");
        let result = document.getElementById("result");
        const weeks = ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期天"];

        function run() {
            let users = text.value.split("\n");
            let index = Math.floor((Math.random() * users.length));
            let name = users[index].trim();
            index = Math.floor((Math.random() * weeks.length));
			name += "的" + weeks[index];
			result.innerText = "结果：" + name;
		}
	</script>

</html>